<meta charset="UTF-8">
<script>
	laydate.render({
	  	elem: '#g_time1',
	  	calendar: true
	});
	laydate.render({
	  	elem: '#g_time2',
	  	calendar: true
	});
	function check(){
			var g_time1 = $("#g_time1").val();
			var g_time2 = $("#g_time2").val();
			if(g_time1==""||g_time2==""){
				bootbox.alert("请选择日期");
				return false;
			}
		}
	
</script>

<div class="modal fade" id="g_myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog">
		<div class="modal-content">
		<div class="modal-header">
			<h3>时间区间导出</h3>
		</div>
		<form id="g_fm" action="ttb/export1?opplyTime&opplyTime1" method="post" onsubmit="return check()">
		 	<div class="modal-body" style="height: 70px;">
				<div class="input-group has-feedback col-md-5"style="float: left; ">
					<span class="input-group-addon">起始日期</span> 
					<input type="text" class="form-control"  name="opplyTime" placeholder="选择起始日期" id="g_time1"/>
					<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
				</div>
				<div class="col-md-1" style="height: 34px; line-height: 34px;">至</div>
				<div class="input-group has-feedback col-md-5"style="float: left; ">
					<span class="input-group-addon">终止日期</span> 
					<input type="text" class="form-control"  name="opplyTime1" placeholder="选择终止日期" id="g_time2"/>
					<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
				</div>
			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-success">
					<span class="glyphicon glyphicon-paste"></span> 导出
				</button>
				<button type="button" class="btn btn-danger" data-dismiss="modal">
					<span class="glyphicon glyphicon-remove"></span> 关闭
				</button>
			</div>
		</form>
		</div>
	</div>
</div>

<table id="table_tj"></table>



<div id="toolbar" class="btn-group">
	<!-- <button data-bind="click:searchClick" type="button"
		class="btn btn-default">
		<span class="glyphicon glyphicon-search" aria-hidden="true"></span><font id="bfont"> 查询</font>
	</button> -->
	<button class="btn btn-default" data-toggle="modal" data-target="#g_myModal">
		<span class="glyphicon glyphicon-paste"></span> 导出
	</button>
</div>

<script type = "text/javascript">
	$("#table_tj").bootstrapTable({
		url: 'ttb/ttb_tj',
		toolbar: '#toolbar',		//绑定指定按钮组
		pagination: true,		//底部工具栏
		sidePagination: 'server',
		sortName: 'id',   //定义那一列可以排序
		pageNumber: 1,
		pageSize: 15,
		pageList: [15, 30, 50],
		showColumns: true,	//选列的下拉菜单
		showRefresh: true,	//刷新按钮
		showToggle: true,	//视图切换
		toolbarAlign: 'left',	//自定义按钮位置
		clickToSelect: true,	//点击行选中
		singleSelect: true,		//单选
		columns: [{
			field: 'user',
			title: '姓名',
			formatter: "courseTypeFormatter"
		},{
			field: 'type',
			title: '调停补类型'
		},{
			field: 'xs',
			title: '学时'
		}],
		queryParams: function (param){	//传递参数
			var params = {};
	        params['offset'] = param.offset; // 页码
	        params['limit'] = param.limit; // 条数
	        params['search'] = param.search; // 搜索内容
	        params['sort'] = param.sort; // 排序字段
	        params['order'] = param.order; // 排序方式
	        return params;
		}
	});

	function courseTypeFormatter(value, row, index){
		return value?value.name: '';
	}
</script>

